<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>User's home</title>
    </h:head>
    <h:body>
        <style>


            .centered{
                vertical-align: middle;
            }

            .fiftyPercent{
                width: 50%;
                text-align: center;
                margin:0px auto;
            }
            .rightAll{
                width: 50%;
                text-align: right;
            }
            .leftAll{
                width: 50%;
                text-align: left;
            }
        </style>
        <ui:composition template="mainlayout.xhtml">
            <ui:define name="content">
                <h:form>
                    <p:panel>
                        <f:facet name="header">
                            <h:panelGroup style="display: block; text-align:center">
                                <h:outputText value="Welcome #{usersView.loggedUser.name}"/>
                            </h:panelGroup>
                        </f:facet>
                        <p:panel header="Your next event is:">
                            <h:panelGrid columns="2" columnClasses="rightAll,leftAll">
                                <h:outputText value="Title:"/>
                                <h:outputText id="eventtitle" value="#{eventView.nextEvent.title}" />
                                <h:outputText value="Start:"/>
                                <h:outputText id="eventstartdate" value="#{eventView.nextEvent.startDate}" />
                                <h:outputText value="End:"/>
                                <h:outputText id="eventenddate" value="#{eventView.nextEvent.endDate}" />
                                <h:outputText value="Place:"/>
                                <h:outputText id="eventplace" value="#{eventView.nextEvent.place}" />
                                <h:outputText value="Description:"/>
                                <h:outputText id="eventdescription" value="#{eventView.nextEvent.description}" />

                            </h:panelGrid>

                        </p:panel>

                        <p:separator />
                        <h:panelGroup style="display:block; text-align:center">
                            <p:commandButton action="#{eventView.startWizardHome}" value="Create Event" />
                            <p:button outcome="/users/calendar" value="View Calendar"/>
                        </h:panelGroup>

                    </p:panel>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

